function [x w] = qrule(points)
% Gaussian Quadrature
% Returns array x and w
        switch  points
        case 1
                pt = .5;
                wght = 1;
        case 2
                    pt = [0.211324865405187,0.788675134594813];
                    wght = [0.5,0.5];
        case 3
               pt =[0.5,0.112701665379258,0.887298334620742];
               wght = [0.444444444444444,0.277777777777776,...
                    0.277777777777776];
       case 4
               pt = [0.330009478207572,6.943184420297372E-002,...
                    0.669990521792428,0.930568155797026];
               wght =[0.326072577431273,0.173927422568727,...
                    0.326072577431273,0.173927422568727];
       case 5
               pt =[0.5,4.691007703066802E-002,0.230765344947158,...
                    0.769234655052841,0.953089922969332];
               wght = [0.284444444444444,0.118463442528095,...
                    0.239314335249683,0.239314335249683,...
                    0.118463442528095];
       case 6
               pt =[0.619309593041598,3.376524289842397E-002,...
                    0.169395306766868,0.380690406958402,...
                    0.830604693233132,0.966234757101576];
               wght = [0.233956967286346,8.566224618958525E-002,...
                    0.180380786524069,0.233956967286346,...
                    0.180380786524069,8.566224618958525E-002];
        case(7)
               pt =[0.5,2.544604382862076E-002,0.129234407200303,...
                    0.297077424311301,0.702922575688699,...
                    0.870765592799697,0.974553956171379];
               wght = [0.208979591836735,6.474248308443483E-002,...
                    0.139852695744638,0.190915025252560,...
                    0.190915025252560,0.139852695744638,...
                    6.474248308443483E-002];
        case 8
               pt =[0.408282678752175,1.985507175123186E-002,...
                    0.101666761293187,0.237233795041836,...
                    0.591717321247825,0.762766204958164,...
                    0.898333238706813,0.980144928248768];
               wght =[0.181341891689181,5.061426814518839E-002,...
                    0.111190517226687,0.156853322938944,...
                    0.181341891689181,0.156853322938944,...
                    0.111190517226687,5.061426814518839E-002];
            case 9
               pt =[0.5,1.591988024618696E-002,8.198444633668206E-002,...
                    0.193314283649705,0.337873288298096,...
                    0.662126711701904,0.806685716350295,...
                    0.918015553663318,0.984080119753813];
               wght =[0.165119677500630,4.063719418078731E-002,...
                    9.032408034742879E-002,0.130305348201468,...
                    0.156173538520001,0.156173538520001,...
                    0.130305348201468,9.032408034742879E-002,...
                    4.063719418078731E-002];
            case 10
               pt =[0.574437169490816,1.304673574141413E-002,...
                    6.746831665550773E-002,0.160295215850488,...
                    0.283302302935376,0.425562830509184,...
                    0.716697697064624,0.839704784149512,...
                    0.932531683344492,0.986953264258586];
               wght =[0.147762112357376,3.333567215434186E-002,...
                    7.472567457529027E-002,0.109543181257991,...
                    0.134633359654998,0.147762112357376,...
                    0.134633359654998,0.109543181257991,...
                    7.472567457529027E-002,3.333567215434186E-002];
            otherwise
        end % end swghtitch statement, wght and pt wghtill have necessary data
        x = pt;
        w = wght;
    end